<%@page import="com.ckeditor.CKEditorConfig"%>
<%@page import="com.tubeonfire.entity.Page"%>
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib uri="http://ckeditor.com" prefix="ckeditor" %>
<%
	Page obj = (Page)request.getAttribute("obj");
	String action = (String)request.getAttribute("action");	
	CKEditorConfig settings = new CKEditorConfig();	
	settings.addConfigValue("height","346");
%>
<jsp:include page="/admin/elements/header.jsp">
	<jsp:param value="Page Form" name="title"/>
</jsp:include>
<script type="text/javascript" src="/admin/js/mine/admin.js"></script>

	<body class="loggedin">
		<jsp:include page="/admin/elements/top.jsp"/>
	    <!-- START OF MAIN CONTENT -->
	    <div class="mainwrapper">
	     	<div class="mainwrapperinner">         	        
				<jsp:include page="/admin/elements/left.jsp">
					<jsp:param value="page" name="current_page"/>
				</jsp:include>					              	                   
	        	<div class="maincontent noright">
	        		<%
	        			if(obj!=null){
	        		%>
	        		<div class="maincontentinner">	            	
		                <ul class="maintabmenu">
		                	<li><a href="/admin/page/list">Manage Page</a></li>
		                    <li class="current"><a href="/admin/page/<%=action.equals("add")?"add":"edit" %>"><%=action.equals("add")?"New":"Edit" %> Page</a></li>		    
		                </ul><!--maintabmenu-->	                
	                	<div class="content">	
	                	<jsp:include page="/admin/elements/message.jsp"/>
	                	<div id="messageDiv" class="notification hidden">						   
						    <p></p>
						</div>	   	                    
	                    	<div class="contenttitle">
	                    		<h2 class="image"><span>Fill Page Information</span></h2>
	                    	</div>
	                    	<br />
		                    <form class="stdform" action="/admin/page/<%=action.equals("add")?"add":"edit" %>" method="post" id="pageForm">
		                    <input type="hidden" name="id" value="<%=obj.getId()%>">     		                                 
		                        <p>
		                        	<label>Page Title</label>
		                            <span class="field">
		                            	<input type="text" name="pageTitle" class="smallinput" value="<%=obj.getTitle()%>"/>		                            	
		                            </span>		                            		                           
		                        </p>    		                                                                                           
		                        <p>
		                        	<label>Page Description</label>
		                            <span class="field">
		                            	<textarea cols="80" rows="5" class="longinput" name="pageDescription"><%=obj.getDescription()%></textarea>		                            			                            
									</span>									
		                        </p>  		                        		                                                       
		                        <p>
		                        	<label>Page Content</label>
		                            <span class="field">		                            
		                            	<textarea cols="80" rows="5" id="pageContent" class="longinput" name="pageContent"><%=obj.getContent()%></textarea>		                            			                            
									</span>									
		                        </p>                                                                                                                                         
                        		<br clear="all" />                  
		                        <p class="stdformbutton">
		                        	<button class="submit radius2" id="btnSubmit">Submit</button>
		                            <input type="reset" class="reset radius2" value="Reset" />		                            		                           
		                        </p>                                                
                    		</form>             
                    		<ckeditor:replace replace="pageContent" basePath="/sources/ckeditor/" config="<%=settings %>"/>
	                    <br /><br />	                    
	                </div><!--content-->	                
	            </div><!--maincontentinner-->
	            <%
	        			}
	            %>
				<jsp:include page="/admin/elements/bottom.jsp"></jsp:include>                    	           	
	        </div><!--maincontent-->	                        
	     	</div><!--mainwrapperinner-->
	    </div><!--mainwrapper-->
		<!-- END OF MAIN CONTENT -->    
	</body>
</html>
